home *** CD-ROM | disk | FTP | other *** search
/ Multimedia Jumpstart / Multimedia Microsoft Jumpstart Version 1.1a (Microsoft).BIN / develpmt / sdk / vfw11.win / vfwdk / init.c1_ / init.bin
Encoding:
Text File  |  1993-11-19  |  4.5 KB  |  188 lines

  1. //==========================================================================;
  2. //
  3. //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. //  PURPOSE.
  7. //
  8. //  Copyright (c) 1992, 1993  Microsoft Corporation.  All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11. //
  12. //  init.c
  13. //
  14. //  Description:
  15. //
  16. //
  17. //
  18. //==========================================================================;
  19.  
  20. #include <windows.h>
  21. #include <windowsx.h>
  22. #include <mmsystem.h>
  23. #include <mmreg.h>
  24. #include <msacm.h>
  25. #include <msacmdrv.h>
  26.  
  27. #include "codec.h"
  28. #include "debug.h"
  29.  
  30.  
  31. HINSTANCE   ghinst;             // DLL instance handle (module in Win 16)
  32.  
  33.  
  34. //==========================================================================;
  35. //
  36. //  WIN 16 SPECIFIC SUPPORT
  37. //
  38. //==========================================================================;
  39.  
  40. #ifndef WIN32
  41.  
  42. //--------------------------------------------------------------------------;
  43. //
  44. //  int LibMain
  45. //
  46. //  Description:
  47. //      Library initialization code.
  48. //
  49. //  Arguments:
  50. //      HINSTANCE hinst: Our module handle.
  51. //
  52. //      WORD wDataSeg: Specifies the DS value for this DLL.
  53. //
  54. //      WORD cbHeapSize: The heap size from the .def file.
  55. //
  56. //      LPSTR pszCmdLine: The command line.
  57. //
  58. //  Return (int):
  59. //      Returns non-zero if the initialization was successful and 0 otherwise.
  60. //
  61. //  History:
  62. //      11/15/92    Created. 
  63. //
  64. //--------------------------------------------------------------------------;
  65.  
  66. int FNGLOBAL LibMain
  67. (
  68.     HINSTANCE               hinst, 
  69.     WORD                    wDataSeg, 
  70.     WORD                    cbHeapSize,
  71.     LPSTR                   pszCmdLine
  72. )
  73. {
  74.     DbgInitialize(TRUE);
  75.  
  76.     //
  77.     //  if debug level is 5 or greater, then do a DebugBreak() to debug
  78.     //  loading of this driver
  79.     //
  80.     DPF(1, "LibMain(hinst=%.4Xh, wDataSeg=%.4Xh, cbHeapSize=%u, pszCmdLine=%.8lXh)",
  81.         hinst, wDataSeg, cbHeapSize, pszCmdLine);
  82.     DPF(5, "!*** break for debugging ***");
  83.  
  84.     //
  85.     //  everything looks good to go in Win 16 land.
  86.     //
  87.     ghinst = hinst;
  88.  
  89.     return (TRUE);
  90. } // LibMain()
  91.  
  92.  
  93. //--------------------------------------------------------------------------;
  94. //  
  95. //  int WEP
  96. //  
  97. //  Description:
  98. //  
  99. //  
  100. //  Arguments:
  101. //      WORD wUselessParam:
  102. //  
  103. //  Return (int):
  104. //  
  105. //  History:
  106. //      03/28/93    Created.
  107. //  
  108. //--------------------------------------------------------------------------;
  109.  
  110. EXTERN_C int FNEXPORT WEP
  111. (
  112.     WORD                    wUselessParam
  113. )
  114. {
  115.     DPF(1, "WEP(wUselessParam=%u)", wUselessParam);
  116.  
  117.     //
  118.     //  always return 1.
  119.     //
  120.     return (1);
  121. } // WEP()
  122.  
  123. #else
  124.  
  125.  
  126. //==========================================================================;
  127. //
  128. //  WIN 32 SPECIFIC SUPPORT
  129. //
  130. //==========================================================================;
  131.  
  132. //--------------------------------------------------------------------------;
  133. //
  134. //  BOOL DllEntryPoint
  135. //
  136. //  Description:
  137. //      This is the standard DLL entry point for Win 32.
  138. //
  139. //  Arguments:
  140. //      HANDLE hinst: Our DLL instance handle.
  141. //
  142. //      DWORD dwReason: The reason we've been called--process/thread attach
  143. //      and detach.
  144. //
  145. //      LPVOID pReserved: Reserved. Should be NULL--so ignore it.
  146. //
  147. //  Return (BOOL):
  148. //      Returns non-zero if the initialization was successful and 0 otherwise.
  149. //
  150. //  History:
  151. //      11/15/92    Created. 
  152. //
  153. //--------------------------------------------------------------------------;
  154.  
  155. EXTERN_C BOOL FNEXPORT DllEntryPoint
  156. (
  157.     HANDLE                  hinst,
  158.     DWORD                   dwReason,
  159.     LPVOID                  pReserved
  160. )
  161. {
  162.     DbgInitialize(TRUE);
  163.  
  164.     switch (dwReason)
  165.     {
  166.         case DLL_PROCESS_ATTACH:
  167.             DPF(1, "DllEntryPoint(hinst=%.08lXh, DLL_PROCESS_ATTACH)", hinst);
  168.             return (TRUE);
  169.  
  170.         case DLL_PROCESS_DETACH:
  171.             DPF(1, "DllEntryPoint(hinst=%.08lXh, DLL_PROCESS_DETACH)", hinst);
  172.             return (TRUE);
  173.  
  174.         case DLL_THREAD_ATTACH:
  175.             DPF(1, "DllEntryPoint(hinst=%.08lXh, DLL_THREAD_ATTACH)", hinst);
  176.             return (TRUE);
  177.  
  178.         case DLL_THREAD_DETACH:
  179.             DPF(1, "DllEntryPoint(hinst=%.08lXh, DLL_THREAD_DETACH)", hinst);
  180.             return (TRUE);
  181.     }
  182.  
  183.     return (TRUE);
  184. } // DllEntryPoint()
  185.  
  186. #endif
  187.  
  188.